/*
 This software is the confidential information and copyrighted work of
 NetCracker Technology Corp. ("NetCracker") and/or its suppliers and
 is only distributed under the terms of a separate license agreement
 with NetCracker.
 Use of the software is governed by the terms of the license agreement.
 Any use of this software not in accordance with the license agreement
 is expressly prohibited by law, and may result in severe civil
 and criminal penalties. 
 
 Copyright (c) 1995-2008 NetCracker Technology Corp.
 
 All Rights Reserved.
 
*/
/*
 * Copyright 1995-2007 by NetCracker Technology Corp.,
 * University Office Park III
 * 95 Sawyer Road
 * Waltham, MA 02453
 * United States of America
 * All rights reserved.
 */
package com.flightan.app.model;


import com.flightan.app.utils.DateParser;

import java.util.Date;

/**
 * Treshchev 15.07.2011 13:44:09
 */
public class Flight
{
    String type; //D or A
    String flightID;

    String code;
    String flight;
    String airline;
    String craft;
    String route;
    Date day;
    Date departureDate;
    Date arrivalDate;
    Date actualDate;
    Date boardingStartDate;
    Date boardingEndDate;
    String boardingStatus;
    Date regStartDate;
    Date regEndDate;
    String regStatus;
    String to;
    String from;
    String status;
    String notes;
    String gate;
    String terminal;

    public Flight()
    {
    }

    public Flight(String type, String code, String flight, String airline, String craft, Date departureDate, Date arrivalDate, Date actualDate, String to, String from, String status, String notes, String gate, String terminal) {
        this.type = type;
        this.code = code;
        this.flight = flight;
        this.airline = airline;
        this.craft = craft;
        this.departureDate = departureDate;
        this.arrivalDate = arrivalDate;
        this.actualDate = actualDate;
        this.to = to;
        this.from = from;
        this.status = status;
        this.notes = notes;
        this.gate = gate;
        this.terminal = terminal;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getFlight() {
        return flight;
    }

    public void setFlight(String flight) {
        this.flight = flight;
    }

    public String getAirline() {
        return airline;
    }

    public void setAirline(String airline) {
        this.airline = airline;
    }

    public String getCraft()
    {
        return craft;
    }

    public void setCraft(String craft)
    {
        this.craft = craft;
    }

    public Date getDay() {
        return day;
    }

    public void setDay(Date day) {
        this.day = day;
    }

    public Date getDepartureDate() {
        return departureDate;
    }

    public void setDepartureDate(Date departureDate) {
        this.departureDate = departureDate;
    }

    public Date getArrivalDate() {
        return arrivalDate;
    }

    public void setArrivalDate(Date arrivalDate) {
        this.arrivalDate = arrivalDate;
    }

    public Date getActualDate() {
        return actualDate;
    }

    public void setActualDate(Date actualDate) {
        this.actualDate = actualDate;
    }

    public Date getBoardingStartDate()
    {
        return boardingStartDate;
    }

    public void setBoardingStartDate(Date boardingStartDate)
    {
        this.boardingStartDate = boardingStartDate;
    }

    public Date getBoardingEndDate()
    {
        return boardingEndDate;
    }

    public void setBoardingEndDate(Date boardingEndDate)
    {
        this.boardingEndDate = boardingEndDate;
    }

    public String getBoardingStatus()
    {
        return boardingStatus;
    }

    public void setBoardingStatus(String boardingStatus)
    {
        this.boardingStatus = boardingStatus;
    }

    public String getRegStatus()
    {
        return regStatus;
    }

    public void setRegStatus(String regStatus)
    {
        this.regStatus = regStatus;
    }

    public Date getRegStartDate()
    {
        return regStartDate;
    }

    public void setRegStartDate(Date regStartDate)
    {
        this.regStartDate = regStartDate;
    }

    public Date getRegEndDate()
    {
        return regEndDate;
    }

    public void setRegEndDate(Date regEndDate)
    {
        this.regEndDate = regEndDate;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getGate() {
        return gate;
    }

    public void setGate(String gate) {
        this.gate = gate;
    }

    public String getTerminal() {
        return terminal;
    }

    public void setTerminal(String terminal) {
        this.terminal = terminal;
    }

    public String getFlightID()
    {
        return flightID;
    }

    public void setFlightID(String flightID)
    {
        this.flightID = flightID;
    }

    public String getRoute()
    {
        return route;
    }

    public void setRoute(String route)
    {
        this.route = route;
    }

    @Override
    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        if (type!=null && !type.isEmpty()) sb.append("type= ").append(type).append("\n");
        if (flightID!=null && !flightID.isEmpty()) sb.append("flightID = ").append(flightID).append("\n");
        if (code!=null && !code.isEmpty()) sb.append("code = ").append(code).append("\n");
        if (flight!=null && !flight.isEmpty()) sb.append("flight = ").append(flight).append("\n");
        if (route!=null && !route.isEmpty()) sb.append("route = ").append(route).append("\n");
        if (airline!=null && !airline.isEmpty()) sb.append("airline = ").append(airline).append("\n");
        if (craft!=null && !craft.isEmpty()) sb.append("craft = ").append(craft).append("\n");
        if (departureDate!=null) sb.append("departureDate = ").append(DateParser.dateForConsole(departureDate)).append("\n");
        if (arrivalDate!=null) sb.append("arrivalDate = ").append(DateParser.dateForConsole(arrivalDate)).append("\n");
        if (actualDate!=null) sb.append("actualDate = ").append(DateParser.dateForConsole(actualDate)).append("\n");
        if (regStartDate!=null) sb.append("regStartDate = ").append(DateParser.dateForConsole(regStartDate)).append("\n");
        if (regEndDate!=null) sb.append("regEndDate = ").append(DateParser.dateForConsole(regEndDate)).append("\n");
        if (regStatus!=null && !regStatus.isEmpty()) sb.append("regStatus = ").append(regStatus).append("\n");
        if (boardingStartDate!=null) sb.append("boardingStartDate = ").append(DateParser.dateForConsole(boardingStartDate)).append("\n");
        if (boardingEndDate!=null) sb.append("boardingEndDate = ").append(DateParser.dateForConsole(boardingEndDate)).append("\n");
        if (boardingStatus!=null && (!boardingStatus.isEmpty())) sb.append("boardingStatus = ").append(boardingStatus).append("\n");
        if (to!=null && !to.isEmpty()) sb.append("to = ").append(to).append("\n");
        if (from!=null && !from.isEmpty()) sb.append("from = ").append(from).append("\n");
        if (status!=null && !status.isEmpty()) sb.append("status = ").append(status).append("\n");
        if (notes!=null && !notes.isEmpty()) sb.append("notes = ").append(notes).append("\n");
        if (gate!=null && !gate.isEmpty()) sb.append("gate = ").append(gate).append("\n");
        if (terminal!=null && !terminal.isEmpty()) sb.append("terminal = ").append(terminal).append("\n");
        return sb.toString();
    }
}